/**
 * ControlLineSegmentListModel.java
 * 
 * @date: 2012-03-13
 * @author: Xiaoyu Guo (MUN# 200982155)
 * This file is part of the course project for COMP 6752, 
 * Application of Computer Graphics. All the file is written
 * by myself.
 */
package mun.cs6752.project.filter.featureWarping;

import java.util.List;

import javax.swing.AbstractListModel;

import mun.cs6752.project.filter.featureWarping.FeatureWarpingParameter.LineSegment;

/**
 * @author Xiaoyu Guo
 *
 */
public class ControlLineSegmentListModel extends AbstractListModel {
    private static final long serialVersionUID = -6398675630497698583L;
    
    private List<LineSegment> lines;
    
    public ControlLineSegmentListModel(List<LineSegment> lines){
        this.lines = lines;
    }

    /* (non-Javadoc)
     * @see javax.swing.ListModel#getSize()
     */
    @Override
    public int getSize() {
        if(lines == null){
            return 0;
        }
        return lines.size();
    }

    /* (non-Javadoc)
     * @see javax.swing.ListModel#getElementAt(int)
     */
    @Override
    public Object getElementAt(int index) {
        return lines.get(index);
    }

}
